<?php

namespace myshop\system\model;

use longhu\base\BaseModel as Model;
/**
 *
 * @property int $config_value_id
 * @property string $config_key
 * @property string $value
 * @property int $mer_id
 * @property timestamp $create_time
 */
class SystemConfigValue extends Model
{
    
    
    public $field = [
        // 配置id
        'config_value_id',
        // 配置分类key
        'config_key',
        // 值
        'value',
        // 商户 id
        'mer_id',
        // 
        'create_time',
        'created_at',
        //
        'updated_at',
        //
        'deleted_at',
    ];
    
    protected $pk = 'config_value_id';

    public $name = 'system_config_value';

    /**
     * @param $value
     * @return mixed
     * @author xaboy
     * @day 2020-03-30
     */
    public function getValueAttr($value)
    {
        return json_decode($value, true);
    }

    /**
     * @param $value
     * @return false|string
     * @author xaboy
     * @day 2020-03-30
     */
    public function setValueAttr($value)
    {
        return json_encode($value);
    }
}